package com.toprs.business.extend

import org.mybatis.dynamic.sql.BasicColumn
import org.mybatis.dynamic.sql.render.TableAliasCalculator
import java.util.*

class MyConstant(private val s: String) : BasicColumn {

    private var alias: String? = null

    override fun alias(): Optional<String> {
        return Optional.ofNullable(alias)
    }

    override fun `as`(alias: String?): MyConstant {
        val myConstant = MyConstant("-1")
        myConstant.alias = alias
        return myConstant
    }

    override fun renderWithTableAlias(tableAliasCalculator: TableAliasCalculator?): String {
        return "\'$s\'"
    }


}